<?php

class Tm_m extends CI_Model{
    function __construct() {
        parent::__construct();
        $this->load->database();
    }
    
    function insert($tb,$arr){
        $this->db->insert($tb,$arr);
    }
    
    function update($tb,$id,$arr){
        $this->db->where('id',$id);
        $this->db->update($tb,$arr);
    }
    
    function delete($tb,$id){
        $this->db->where('id',$id);
        $this->db->delete($tb);
    }
    
    function select($tb,$id){
        $this->db->where('id',$id);
        $this->db->select('*');
        $query=$this->db->get($tb);
        return $query->result();
    }    
    
    function getlist($tb,$taskid){
        $this->db->where('taskid',$taskid);
        $this->db->select('*');
        $query=$this->db->get($tb);
        return $query->result();
    }
}

